﻿<%@ Page MasterPageFile="~/admin/MasterPage.master" Language="C#" AutoEventWireup="true" CodeFile="administrators.aspx.cs" Inherits="admin_administrators" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server" >
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="ListAllUsers" DataSourceID="UsersListDataSource" AutoGenerateColumns="False"
            runat="Server" CellPadding="4" AllowPaging="True" DataKeyNames="id" PageSize="1000"
            GridLines="Vertical" CssClass="FullWidthSpace" 
            AutoGenerateEditButton="True">
            <RowStyle CssClass="OddRow" />
            <PagerStyle CssClass="SelectionDataTablePager" />
            <HeaderStyle CssClass="SelectionDataTableHeader" />
            <PagerTemplate>
               
            </PagerTemplate>
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="return confirm('Вы действительно хотите удалить этого пользователя?');" 
                        CommandName="Delete">Delete</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-CssClass="RightAlignStyle" HeaderText="№ п\п">
                    <ItemTemplate>
                        <%# Convert.ToString( Container.DataItemIndex + 1 ) %>
                    </ItemTemplate>
                    <ItemStyle CssClass="RightAlignStyle"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Логин">
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# Eval("login")%>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox runat="server" Text='<%# Eval("login")%>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text=''></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Пароль">
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# Eval("psswd")%>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox runat="server" Text='<%# Eval("psswd")%>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text=''></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
            <AlternatingRowStyle CssClass="EvenRow" />
        </asp:GridView>
        <asp:LinkButton ID="New" Text="Добавить нового пользователя" OnCommand="AddUser" runat="server" />
        <asp:LinkButton ID="Attempt" Text="Добавить" OnCommand="Insert" runat="server" />
        <asp:LinkButton ID="Discard" Text="Отменить" OnCommand="Cancel" runat="server" />
        <asp:SqlDataSource ID="UsersListDataSource" runat="server" SelectCommandType="StoredProcedure" 
            SelectCommand="GetUserList" ConnectionString="<%$ConnectionStrings:TestBase %>">
        </asp:SqlDataSource>
     </div>
     </form>
</asp:Content>
